Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Creating a dynamic query
Now take a look at
getQuery. It first creates a dynamic query, to pass back as anOUTPUTparameter (hence the naming conventionohQuery):
Then it walks through the list of buffer names passed in, creates a dynamic buffer for each one, and adds each buffer to the query:
Finally, it prepares the dynamic query using the
FOR EACHstatement passed in:
This is a general-purpose mechanism for creating not only any dynamic query, but also all the buffers it uses, without defining anything in advance. It’s prepared to work against any list of tables for any database.
It’s also a good idea to look at the
cleanupQueryfunction, which reminds you to always delete dynamic objects when you’re done with them. It deletes the query and then all the dynamic buffers the query used:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |